package day4;

import java.util.Random;
import java.util.Scanner;

public class te4 {
    public static void main(String[] args) {
        Random r = new Random();
        Scanner sc =new Scanner(System.in);
        int number = r.nextInt(100);
        number +=1;
        int guess=0 , time=0;
        while(guess!= number){
            if(time == 0)System.out.println("请输入你要猜的数字：");
            else  System.out.println("别气馁，再猜一次：");
            guess = sc.nextInt();
            if(guess > number ) System.out.println("猜大了");
            if(guess < number ) System.out.println("猜小了");
            if(guess == number ) System.out.println("恭喜你，猜中了！");
            time++;
        }
    }
}
